package com.ruoyi.base.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 科目管理对象 financial_subject
 *
 * @author ruoyi
 * @date 2025-02-23
 */
@TableName(value = "financial_subject")
public class Subject extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 科目名称 */
    @Excel(name = "科目名称")
    @NotBlank(message = "科目名称不能为空")
    private String name;

    /** 科目编码 */
    @Excel(name = "科目编码")
    @NotBlank(message = "科目编码不能为空")
    private String code;

    /** 类型 */
    @Excel(name = "类型")
    private Long subjectType;

    /** 余额方向 */
    @Excel(name = "余额方向")
    private Long balanceDirection;

    /** 状态 */
    @Excel(name = "状态")
    private Long status;

    /** 辅助核算 */
    @Excel(name = "辅助核算")
    private String auxiliaryAccounting;

    /** 上级科目id */
    @Excel(name = "上级科目id")
    @NotNull(message = "上级科目不能为空")
    private Long pid;

    /** 逻辑删除 */
    @Excel(name = "逻辑删除")
    private Integer isDel;

    @TableField(exist = false)
    public List<Subject> children;


    public List<Subject> getChildren() {
        return children;
    }

    public void setChildren(List<Subject> children) {
        this.children = children;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setName(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }
    public void setCode(String code)
    {
        this.code = code;
    }

    public String getCode()
    {
        return code;
    }
    public void setSubjectType(Long subjectType)
    {
        this.subjectType = subjectType;
    }

    public Long getSubjectType()
    {
        return subjectType;
    }
    public void setBalanceDirection(Long balanceDirection)
    {
        this.balanceDirection = balanceDirection;
    }

    public Long getBalanceDirection()
    {
        return balanceDirection;
    }
    public void setStatus(Long status)
    {
        this.status = status;
    }

    public Long getStatus()
    {
        return status;
    }
    public void setAuxiliaryAccounting(String auxiliaryAccounting)
    {
        this.auxiliaryAccounting = auxiliaryAccounting;
    }

    public String getAuxiliaryAccounting()
    {
        return auxiliaryAccounting;
    }
    public void setPid(Long pid)
    {
        this.pid = pid;
    }

    public Long getPid()
    {
        return pid;
    }

    public void setIsDel(Integer isDel)
    {
        this.isDel = isDel;
    }

    public Integer getIsDel()
    {
        return isDel;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("code", getCode())
                .append("subjectType", getSubjectType())
                .append("balanceDirection", getBalanceDirection())
                .append("status", getStatus())
                .append("auxiliaryAccounting", getAuxiliaryAccounting())
                .append("pid", getPid())
                .append("isDel", getIsDel())
                .toString();
    }
}
